package edu.pku.sei.modeler.util;
import java.io.IOException;

import org.eclipse.core.runtime.Platform;

import edu.pku.sei.modeler.main.Activator;

/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */

/**
 * @author jesse
 *
 */
public class PathDescriptor {
	public String getAbsolutePath(){
/*			System.out.println(
	            Thread.currentThread().getContextClassLoader().getResource(""));
	        System.out.println(PathDescriptor.class.getClassLoader().getResource(""));
	        System.out.println(ClassLoader.getSystemResource(""));
	        System.out.println(PathDescriptor.class.getResource(""));
	        System.out.println(PathDescriptor.class.getResource("/"));
	        System.out.println(new File("").getAbsolutePath());
	        System.out.println(System.getProperty("user.dir"));
	        System.out.println(MetaModelerPlugin.getDefault().getStateLocation());
	        ResourcesPlugin.getPlugin().getBundle();
*/	    
		String url = "";
		try {
				url = Platform.asLocalURL(Activator.getDefault().getBundle().getEntry("")).getPath();
				
//				System.out.println(url);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return url;
	}
	
	public String getRuntimeAbsolutePath(){
		return Platform.getInstanceLocation().getURL().getPath();


	}
	
}
